import request from '@/utils/request/request';

// 获取角色管理列表
export function getRoleList(params) {
  return request.post('/enterprise/role/list', params);
}
// 新建角色
export function addRole(params) {
  return request.post('/enterprise/role/add', params);
}
// 编辑角色
export function updateRole(params) {
  return request.post('/enterprise/role/update', params);
}
// 删除角色
export function deleteRole(params) {
  return request.post('/enterprise/role/delete', params);
}

// 获取权限树
export function getAuthTree(params) {
  return request.post('/enterprise/permission/table', params);
}

//  授权管理列表
export function getAuthList(params) {
  return request.post('/enterprise/user/getrelationaccoutpage', params);
}

// 给角色授权
export function toAuthorize(params) {
  return request.post('/enterprise/menu/authorize', params);
}

// 给用户加角色
export function addRoleToUser(params) {
  return request.post('/enterprise/user/allocaterole', params);
}

// 给用户授权
export function toUserAuthorize(params) {
  return request.post('/enterprise/user/allocatepermission', params);
}
